<?php

/* @var $this yii\web\View */
/* @var $title string */
/* @var $message string */
/* @var $previousPage string */
/* @var $errorCode integer */
/* @var $exception Exception */

$this->title = $title;
$urlInfo = parse_url($previousPage);
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title><?= $title ?></title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <link href="/css/error.css" rel="stylesheet">
    </head>
    <body class="error-404">
    <div id="doc_main">
        <section class="bd clearfix">
            <div class="module-error">
                <div class="error-main clearfix">
                    <div class="label"></div>
                    <div class="info">
                        <h3 class="title">错误: <?= $message ?> </h3>
                    <?php if ($errorCode == 403) { ?>
                        <div class="reason">
                            <p>可能的原因：</p>
                            <p>1. 登录过了保质期。</p>
                            <p>2. 此页面您没有权限查看。</p>
                        </div>
                    <?php } else { ?>
                        <div class="reason">
                            <p>可能的原因：</p>
                            <p>1. 手抖打错了。</p>
                            <p>2. 链接过了保质期。</p>
                            <p>2. 尝试多次无果，可直接联系站点管理员。</p>
                        </div>
                    <?php } ?>
                        <div class="oper">
                            <?php if ($errorCode == 403) { ?>
                                <p><a href="javascript:;" id="toLogin">去登陆&gt;</a></p>
                            <?php }?>
                        </div>
                    </div>
                </div>
            </div>
        </section>
    </div>
    <?= $this->registerJsFile("/js/common.js");?>
    <?= $this->registerJsFile("/js/jquery.min.js");?>
    <?= $this->registerJs("
        if(self.frameElement === null) {
            jQuery('#toLogin').on('click', function() {
                window.location.href = \$w.getPageUrl('login');
            });
        }
    ");?>
    </body>
</html>
